package com.caixin.common.enums;

public enum SysConfigEnum {

    SITE_NAME("JAVA信息管理系统", "JAVA信息管理系统"),
    DOMAIN_NAME("http://localhost:", "域名"),
    DOMAIN_PORT("8080", "端口号");

    private String name ;
    private String code ;

    private SysConfigEnum( String code , String name){
        this.code = code ;
        this.name = name ;
    }
    public String getName() {
        return name;
    }
    public String getCode() {
        return code;
    }

    /**
     * @description: 根据code获取枚举
     * @author: caixin
     * @date: 2021/11/20 23:46
     * @param: code
     * @return: com.domain.common.enums.SysConfigEnum
     */
    public static SysConfigEnum getByCode(String code) {
        for (SysConfigEnum e : SysConfigEnum.values()) {
            if (code.equalsIgnoreCase(e.getCode())) {
                return e;
            }
        }
        return null;
    }

}
